package com.library.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 图书实体
 */
@Data
@TableName("book")
public class Book {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private String isbn;
    
    private String title;
    
    private String author;
    
    private String publisher;
    
    private LocalDate publishDate;
    
    private Long categoryId;
    
    private String cover;
    
    private String description;
    
    private Integer totalStock;
    
    private Integer availableStock;
    
    private Integer borrowCount;
    
    @TableLogic
    private Integer deleted;
    
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    @TableField(exist = false)
    private String categoryName;
}

